using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Colorprj.Login;
namespace Colorprj
{
    
    public partial class frmLogin : Form
    {
        LoginManager lm = new LoginManager();
        public frmLogin()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                LoginUser lu = lm.GetUser(txtUserName.Text);
                if (txtPassword.Text.Equals(lu.PassWord))
                {
                    MDIMain mdimain = new MDIMain();
                    lm.setCompany();
                    mdimain.Show();
                    this.Hide();
                }
                else { MessageBox.Show("Incorrect Password !"); }
            } 
            catch(Exception e1){

                MessageBox.Show(e1.Message);  
            }
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}